#include <stdlib.h>
#include <limits.h>

#include "RandRange.h"

/* Returns an integer between [min, max)
 *
 * IE: Python Syntax
 */
int randrange(int min, int max) {
  int diff = max - min;
  if ( diff <= 0 ) {
    return -INT_MAX;
  }
  int toReturn = rand() % diff;
  return toReturn + min;
}


